cmake_minimum_required(VERSION 3.10)
project(demos LANGUAGES CXX)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(VTK COMPONENTS)

if (NOT VTK_FOUND)
    message(FATAL_ERROR "Unable to find the VTK build folder.")
endif()

# set(wxWidgets_ROOT_DIR E:\\librarys\\wxWidgets)
set(wxWidgets_ROOT_DIR $ENV{WX_ROOT})
# 查找 wxWidgets 库
find_package(wxWidgets REQUIRED COMPONENTS core base)

# 如果找到了 wxWidgets 库
if(NOT wxWidgets_FOUND)
    message(FATAL_ERROR "wxWidgets not found!")
endif()

# 包含 wxWidgets 使用的 CMake 文件
include(${wxWidgets_USE_FILE})

aux_source_directory(./ DIR_SRCS)
# set(TESTEXEC )
foreach(FILE_PATH ${DIR_SRCS})
    # message(${FILE_PATH})
    STRING(REGEX REPLACE ".+/(.+)\\..*" "\\1" FILE_NAME ${FILE_PATH})
    # MESSAGE(${FILE_NAME})
    add_executable(${FILE_NAME}  ${FILE_PATH} )
    target_link_libraries(${FILE_NAME} PRIVATE ${wxWidgets_LIBRARIES})
    list(APPEND TESTEXEC ${FILE_NAME})
    set_target_properties(${FILE_NAME} PROPERTIES WIN32_EXECUTABLE ON)
endforeach(FILE_PATH ${DIR_SRCS})
message(${TESTEXEC})


# 添加 wxWidgets 的头文件路径
# target_include_directories(MyWxWidgetsApp PRIVATE ${wxWidgets_INCLUDE_DIRS} )


